﻿<Window x:Class="DirectoryEndDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    Title="{x:Static Tools.Metanol.My.Resources:Resources.txt_FolderBrowsing}"
        Height="382" Width="623" ShowInTaskbar="False" DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
    FocusManager.FocusedElement="{Binding ElementName=lstFolders}" xmlns:Tools.Metanol.My.Resources="clr-namespace:Tools.Metanol.My.Resources">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Text="{x:Static Tools.Metanol.My.Resources:Resources.txt_EndOfFolderReached}" Name="txbI1" HorizontalAlignment="Left"/>
        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Content="{x:Static Tools.Metanol.My.Resources:Resources.txt_CurrentFolder}" Target="{Binding ElementName=txtFolder}" HorizontalAlignment="Left"/>
        <TextBox Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3" Text="{Binding Folder}" IsReadOnly="True" IsTabStop="False" Focusable="False" />
        <ListBox Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Grid.RowSpan="3" Name="lstFolders" SelectionMode="Single" DisplayMemberPath="DisplayName" SelectedValuePath="Path" />
        <Button Grid.Column="2" Grid.Row="3" Name="btnOK" Content="{x:Static Tools.Metanol.My.Resources:Resources.txt_UseFolder}" IsDefault="True">
            <Button.Style>
                <Style TargetType="Button">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=lstFolders, Path=SelectedIndex}" Value="-1">
                            <Setter Property="IsEnabled" Value="False"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=lstFolders, Path=SelectedValue}" Value="{x:Static sys:String.Empty}">
                            <Setter Property="IsEnabled" Value="False"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Button.Style>
        </Button>
        <Button Grid.Column="2" Grid.Row="4" Name="btnCancel" Content="{x:Static Tools.Metanol.My.Resources:Resources.txt_Cancel}" IsCancel="True"/>
        <TextBox Grid.Column="0" Grid.Row="6" Text="{x:Static Tools.Metanol.My.Resources:Resources.txt_EnterFolderKeys}" HorizontalAlignment="Right"/>
        <TextBox Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="2" Text="{x:Static Tools.Metanol.My.Resources:Resources.txt_EnterFolder}" HorizontalAlignment="Left"/>
        <TextBox Grid.Column="0" Grid.Row="7"  Text="{x:Static Tools.Metanol.My.Resources:Resources.txt_FolderUpKeys}" HorizontalAlignment="Right"/>
        <TextBox Grid.Column="1" Grid.Row="7" Grid.ColumnSpan="2" Text="{x:Static Tools.Metanol.My.Resources:Resources.txt_FolderUpDesc}" HorizontalAlignment="Left"/>
    </Grid>
</Window>
